
package ttu.idu0080.courierofferservice;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;

public final class CourierService_CourierServicePort_Client
{
  private static final QName SERVICE_NAME = new QName("http://server.order.idu0080.ttu/", "CourierServiceService");

  public Courier getCourierById(int courierId)
  {
		Courier courierGotById = null;
		URL wsdlURL = CourierServiceService.WSDL_LOCATION;
		String[] args = {""};
		
		if (args.length > 0) 
		{
		  File wsdlFile = new File(args[0]);
		  try 
		  {
		    if (wsdlFile.exists()) 
		    {
		      wsdlURL = wsdlFile.toURI().toURL();
		    }
		  }
		  catch (MalformedURLException e)
		  {
		    e.printStackTrace();
		  }
		}

	    CourierServiceService ss = new CourierServiceService(wsdlURL, SERVICE_NAME);
	    CourierService port = ss.getCourierServicePort();
	
	    System.out.println("Invoking getCourierById...");
	    courierGotById = port.getCourierById(courierId);
	    System.out.println("getCourierById.result=" + courierGotById.getName());
	
	    return courierGotById;
        
    
        /*------------------------------TEENUSED, MIDA ANTUD KONTEKSTIS EI VAJA----------------------------
        {
        System.out.println("Invoking getAllCouriers...");
        java.util.List<ttu.idu0080.courierofferservice.Courier> _getAllCouriers__return = port.getAllCouriers();
        System.out.println("getAllCouriers.result=" + _getAllCouriers__return);
        }
        
        {
	        System.out.println("Invoking getCouriersByAddress...");
	        java.lang.String _getCouriersByAddress_country = "_getCouriersByAddress_country-1697414420";
	        java.lang.String _getCouriersByAddress_county = "_getCouriersByAddress_county1391331430";
	        java.util.List<ttu.idu0080.courierofferservice.Courier> _getCouriersByAddress__return = port.getCouriersByAddress(_getCouriersByAddress_country, _getCouriersByAddress_county);
	        System.out.println("getCouriersByAddress.result=" + _getCouriersByAddress__return);
        }

        System.exit(0);
        */
    }

}
